﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Appetite.Domain.Models
{
    public class Recipe : Entity
    {
        [StringLength(500)]
        [Required]
        [DataType(DataType.MultilineText)]
        public string Description { get; set; }
        
        [StringLength(30)]
        [Required]
        public string Title { get; set; }

        [Range(0,360)]
        public int TimeInMinutes { get; set; }

        public List<Tag> Tags { get; set; }

        private RecipeCategory _recipeCategory;
        public RecipeCategory RecipeCategory
        {
            get { return _recipeCategory; }
            set
            {
                _recipeCategory = value;
                RecipeCategoryId = value.Id;
            }
        }

        public Guid RecipeCategoryId { get; set; }
    }
}